package net.javashop.web.listener;

import javax.servlet.ServletContextEvent;
import net.javashop.web.context.SpringContext;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * @author wqq
 *
 */
public class SpringContextLoaderListener extends ContextLoaderListener {
	public void contextInitialized(ServletContextEvent event) {
		super.contextInitialized(event);
		SpringContext.setApplicationContext(WebApplicationContextUtils
				.getWebApplicationContext(event.getServletContext()));
		SpringContext.setServletContext(event.getServletContext());
	}
}
